/*
 * @Author: 烟浮
 * @Date: 2022-07-01 13:35:52
 * @LastEditTime: 2022-07-01 15:57:08
 * @LastEditors: 锦墨涵秋 275740441@qq.com
 * @FilePath: /viteDocker/src/utils/date-format.ts
 */
import dayjs from 'dayjs'
import utc from 'dayjs/plugin/utc'

dayjs.extend(utc)

const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss'
const DATE_FORMAT = 'YYYY-MM-DD'

export function utcToDateTimeFormat(utcDate: string, format: string = DATE_TIME_FORMAT) {
  return dayjs.utc(utcDate).utcOffset(8).format(format)
}
